package Year21_Month11.day1112;

public class Soultion1 {
    //检验二进制中1的个数
    public static int hammingWeight(int n) {
        int count = 0;
        for(int i  = 1; i <= 32;i++){
            if(((n >>> 1) & 1) == 1){
                count++;
            }
        }
        return count;
    }

    public static void main(String[] args) {
        System.out.println(hammingWeight(11));
    }
}
